package com.jxlg.web;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
@RestController
public class Hello {
    @GetMapping("/JJ")//请求方式
    public String hello()
    {
        return "deng is good men!";
    }

    @PostMapping ("/kk")
    public String test()
    {
        return " 11111 + 1111111 = 2";
    }
    @PostMapping("/ww")
    public Wife dd()
    {
        Wife wife = new Wife(1,"list",50000);
        return wife;
    }
    @GetMapping("/i")
    public List<Wife> w ()
    {
        Wife wife1 = new Wife(1,"list",500000);
        Wife wi = new Wife(2,"lis",500000000);
        List<Wife> list = new ArrayList<>();
        list.add(wi);
        list.add(wife1);
        return list;
    }
    @GetMapping("/p")
    public Person p()
    {
        Person p = new Person(1,"men",new Wife(2,"woman",500000));
        return p;
    }
    @GetMapping("/t")
    public Two tt()
    {
        Two s = new Two(1,"nan",new Wife(1,"nv",200000000),
                new Wife(1,"nv",200000000),new Wife(1,"nv",200000000));
        return s;
    }
    @GetMapping("/tt")
    public Bosh t()
    {
        Bosh b = new Bosh();
        b.setId(2);
        b.setName("women");
        List<Wife>  list = new ArrayList<>();
        list.add(new Wife(1,"men",9000000));
        list.add(new Wife(3,"mens",9000000));
        b.setList(list);
        return b;
    }
}
